

<%= form_for [:cpanel, category], :html => {:class => 'form-vertical'} do |f|%>

	<div id="category_form" class="modal hide">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
			<h3 id="add_category_label">
				<% if "create" == tag%>
					新建分类
				<% elsif "update" == tag %>
					更新分类
				<% elsif "show" == tag %>
					查看分类
				<% end -%>
			</h3>
		</div>
		<div class="modal-body">
			<p>
				<%= f.hidden_field :id, id: category.id %>
				<%= f.label :分类名称,:class => 'control-label'%> 
				<div class="controls"><%= f.text_field :name, value: category.name %></div>

				<%= f.label :分类描述,:class => 'control-label' %> 
				<div class="controls"><%= f.text_area :description ,cols: 40,rows: 5, value: category.description %></div>
			</p>
		</div>
		<div class="modal-footer">
			<button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
			<% if "show" != tag %> 
				<%= button_tag "保存", class: "btn btn-primary" %>
			<% end -%>
		</div>
	</div>
<% end -%>